<?php 
/* @var $this Zend_View */



/* @var $this Zend_View */
echo'<link rel="stylesheet" media="screen,projection,tv" href="'.$this->baseUrl('css/dataGrid/screen.css').'" type="text/css" />';
echo'<link rel="stylesheet" media="screen,projection,tv" href="'.$this->baseUrl('css/dataGrid/maite.tabella.css').'" type="text/css" />';
?>

Kontroler Crud damian
Akcja edit

<script type="text/javascript">
$(document).ready(
	    function()
	    {
	       console.log('Jquery');
	    });
</script>
<?php 
# DATA GRID


 if( $this->paginate->success == true)  
 {  
 			$paginate=$this->paginate;
 			
            # Get the results 
            $result = $paginate->resultset->fetchAll();  
              
            echo '<table class="tabella">';
            
            echo '<tbody class="tabella-body">';
            
            # NAGŁÓWKI
            echo '<tr>
                    <th style="width: 200px;" >id</th>
                    <th style="width: 200px;" >'.$paginate->links_html_order[1].'</th>
                    <th style="width: 150px;" >'.$paginate->links_html_order[2].'</th>
                    <th style="width: 100px;" >'.$paginate->links_html_order[3].'</th>
                    <th style="width: 200px;" >'.$paginate->links_html_order[4].'</th>
                    <th style="width: 200px;" >'.$paginate->links_html_order[5].'</th>
                    <th style="width: 200px;" >'.$paginate->links_html_order[6].'</th>
                    <th style="width: 200px;" >opis</th>
                    <th style="width: 200px;" > opis postęp</th>
                    <th style="width: 200px;" >uwagi</th>
                    <th style="width: 200px;" >wykonanie %</th>
                    <th style="width: 200px;" > </th>
                  </tr>'; 
            
            Application_Model_Narzedziowe_CVarDumper::dodaj($result,'$result w widoku');
            # WIERSZE
            foreach($result as $row)  
            {  
                echo '<form name="test_formularz" method="post" action="'.$this->url(array('controller'=>'index','action'=>'aktualizacja')).'" >';

                
                if( $row['id'] == $_POST['wybor'] )
                {
                	echo'<tr>
                			<td>'.$row['id'].'</td>
                			<td><input type="type" size="10" name="procent_wykonania" value=" '.$row['nazwa'].'" /></td>
                			<td><input type="type" size="10" name="procent_wykonania" value=" '.$row['projekt'].'" /></td>
                			<td><input type="type" size="10" name="procent_wykonania" value=" '.$row['dotyczy'].'" /></td>
                			<td><input type="type" size="10" name="procent_wykonania" value=" '.$row['kategoria'].'" /></td>
                			<td><input type="type" size="10" name="procent_wykonania" value=" '.$row['data planowana'].'" /></td>
                			<td><textarea rows="2" cols="20"> '.$row['opis'].'</textarea></td>
                			<td><textarea rows="2" cols="20"> '.$row['postep'].'</textarea></td>
                			<td><input type="type" size="20" name="piorytet" value=" '.$row['uwagi'].'" /></td>
                			<td><input type="type" size="5" name="piorytet" value=" '.$row['piorytet'].'" /></td>
                			<td><input type="type" size="5" name="procent_wykonania" value=" '.$row['procent'].'" /></td>
                			<td><input type="submit"  name="nn" value="ZATWIERZ" /></td>
                	</tr>';
                }
                else
                {
                	echo '
                	<tr>
                			<td>'.$row['id'].'</td>
                			<td> '.$row['nazwa'].'</td>
                			<td>'.$row['projekt'].'</td>
                			<td>'.$row['dotyczy'].'</td>
                			<td>'.$row['kategoria'].'</td>
                			<td>'.$row['data planowana'].'</td>
                			<td>'.$row['opis'].'</td>
                			<td>'.$row['postep'].'</td>
                			<td>'.$row['uwagi'].'</td>
                			<td>'.$row['piorytet'].'</td>
                			<td>'.$row['procent'].'</td>
                			<td> </td>
                	</tr>';
                	
                } 
                
                echo '<input type="hidden" name="id" value="'.$row['id'].'" />';
                echo $paginate->hiddeny;
                echo'</form>';  //
            }
            
            echo '</tbody>';  
            echo '</table>';  
              
            # Show the paginated links ( 1 2 3 4 5 6 7 ) etc.  
            echo '<div class="tabella-footer">'; 
            echo $paginate->links_html;  
            echo '</div>';
              
            # Get the total number if pages if you like   
            echo '<br>Ilość stron:';   
            echo $paginate->total_pages;  
              
            # Get the total number of results if you like 
            echo '<br>Ilość wyników:'.$paginate->total_results;  
 }
 else
 {
      echo 'Błąd podczas otrzymywania danych.';
 } 
     

